import pytest
from loguru import logger

from cases.case_auth import AuthCase
from common.handle_mysql import HandleMysql
from common.handle_redis import HandleRedis
from common.utils import Utils


@pytest.fixture(scope='session')
def get_success_Authorization():
    ac = AuthCase()
    code_sign = ac.case_code()
    sign = code_sign['data']['sign']
    value = HandleRedis(**ac.redis_conf).get(sign)
    u = Utils()
    token = u.get_toC_Authorization(value, sign)
    return token
